home *** CD-ROM | disk | FTP | other *** search
/ Windows 6-Pak - Disc 5 / Windows 6-Pak (InfoMagic) (Disc 5) (1999).ISO / Scripting-Tools / js15full.exe / Form.ht_ / Form.ht
Encoding:
Text File  |  1998-04-02  |  2.3 KB  |  54 lines

  1. <html>
  2.  
  3. <head><script language="JavaScript">
  4. <!-- Hide the script from old browsers --
  5.  
  6. //======================================================
  7. // Java Script code by Java Script It!   www.computan.on.ca/~todd/JavaScriptIt!
  8. //======================================================
  9.  
  10. function validate (form) {
  11.     r=1;
  12. if(confirm("Submit form now?")){if (form.email.value.indexOf('@',0)==-1) r=0;if (form.URLS.value=="")r=0;if(form.use[0].checked==false && form.use[1].checked==false ) r=0;if (r==0) { alert('Form will not be submitted because you failed to fill out all the required parts of the form.'); return false; }else { return true; }}else {return false}}function confirmReset (form) {
  13.     if (confirm("Are you sure you want to clear the form?")) {return true}
  14.     else {return false}
  15. }
  16. //------------------></script><title>Form Verify</title>
  17. </head>
  18.  
  19. <body bgColor="#FFFFFF" text="000000">
  20.  
  21. <div align=center><font size=6 font="Arial"><b>Form Verify</b></font></div><p>
  22.  
  23. Form verify will check the form to make sure the user filled out the required elements correctly before submiting it to the server. The form below will not be submitted unless you fill out all elements.<p>
  24.  
  25. <form name="test" method=post action="http://www.bogus.com/cgi/bogusScript.pl" onSubmit="return validate (this)" onReset="return confirmReset(this)" >
  26.  
  27. Please choose whether this page is:
  28. <input type="radio" name="use" value="Useful">Useful 
  29. <input type="radio" name="use" value="Not Useful">Not Useful<p>
  30.  
  31.  
  32. Please enter your e-mail address: 
  33. <input type=text name="email" valu="" size=35><p>
  34.  
  35. Please enter a brief comment about this page:<br>
  36. <TEXTAREA NAME="URLS" ROWS=7 COLS=60></textarea><p>
  37.  
  38. <input type=submit value="Send In Bogus Form">
  39. <input type=reset value="Clear Form"><p>
  40.  
  41. </form>
  42.  
  43. <b>Browser Compatibility</b><br>
  44. ò Works in Netscape Navigator 2.01 except for the confirmation of the Reset button does not work<br>
  45. ò Works fully in Netscape Navigator 3.0 and higher<br>
  46. ò Works in Microsoft Internet Explorer 3.0 except for the confirmation of the Reset button does not work<br>
  47. ò Works fully in Microsoft Internet Explorer 4.0 and higher<br>
  48. ò No errors should occur in browsers that do not understand the code but verification will not work
  49.  
  50. </body>
  51.  
  52. </html>
  53.  
  54.